//
//  MZReadingView.m
//  WHISPER
//
//  Created by lanou3g on 15/12/17.
//  Copyright © 2015年 王艳苹. All rights reserved.
//

#import "MZReadingView.h"

@implementation MZReadingView

- (UIScrollView *)sv
{
    if (!_sv) {
        _sv = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.frame),223 * ([UIScreen mainScreen].bounds.size.height / 667.0))];
        [self addSubview:_sv];
    }
    return _sv;
}

- (UICollectionView *)cv
{
    if (!_cv) {
        UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc] init];
        flow.itemSize = CGSizeMake(120 * ([UIScreen mainScreen].bounds.size.width / 375.0) , 120 * ([UIScreen mainScreen].bounds.size.height / 667.0));
        
        flow.minimumInteritemSpacing = 5 * ([UIScreen mainScreen].bounds.size.width / 375.0);
        flow.minimumLineSpacing = 5 * ([UIScreen mainScreen].bounds.size.width / 375.0);
        
        flow.sectionInset = UIEdgeInsetsMake(5 * ([UIScreen mainScreen].bounds.size.height / 667.0), 0, 5 * ([UIScreen mainScreen].bounds.size.height / 667.0), 0);
        
        _cv = [[UICollectionView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.sv.frame), CGRectGetWidth(self.frame),380 * ([UIScreen mainScreen].bounds.size.height / 667.0)) collectionViewLayout:flow];
        [self addSubview:_cv];
    }
    return _cv;
}

@end
